﻿using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;

namespace PmSoft
{
	[Serializable]
	public class PagedList<T> : List<T>, IPagedList<T>
	{

		public PagedList(IEnumerable<T> items, int pageNum, int pageSize, int total, double? duration =null)
		{
			AddRange(items);
			Total = total;
			PageNum = pageNum;
			PageSize = pageSize;
			Duration = duration;
		}

		public PagedList(IQueryable<T> items, int pageNum, int pageSize, int total, double? duration = null)
		{
			AddRange(items);
			Total = total;
			PageNum = pageNum;
			PageSize = pageSize;
			Duration = duration;
		}

		public int PageNum { get; private set; }

		public int PageSize { get; private set; }

		public int Total { get; private set; }

		public double? Duration { get;private set; }
	}
}
